home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / RMTP03.ARJ / READXGF.PAS < prev    next >
Pascal/Delphi Source File  |  1992-02-25  |  989b  |  29 lines

  1. Program ReadXgf;
  2.  Uses Graph;
  3. Var
  4.  F    : File;
  5.  Img  : Pointer;
  6.  Size : LongInt;
  7.  Gd   : Integer;
  8.  Gm   : Integer;
  9. Begin
  10.  Gd:=EGA;
  11.  Gm:=EGAHi;
  12.  InitGraph(Gd,Gm,'');           (* Set path where EGAVGA.BGI *)
  13.                                 (* is located                *)
  14.  
  15.  SetFillStyle(SolidFill,Blue);
  16.  Bar(0,0,639,349);
  17.  
  18.  Assign(F,'GCAR.XGF');          (* Gcar.xgf must be in current directory *)
  19.  Reset(F,1);
  20.  Size:=FileSize(F);             (* Get size of file, must 64K or less    *)
  21.  GetMem(Img,Size);              (* Allocate memory                       *)
  22.  BlockRead(F,Img^,Size);        (* Read contents of file into buffer     *)
  23.  Close(F);
  24.  
  25.  PutImage(300,150,Img^,NormalPut);   (* Display image                    *)
  26.  FreeMem(Img,Size);                  (* Free memory                      *)
  27.  Readln;                             (* Wait for enter key               *)
  28.  CloseGraph;                         (* Close graphics                   *)
  29. End.